'''
构造类
'''
class Person:
    def __init__(self,name,age,sex):
        self.name = name
        self.age = age
        self.sex = sex
class  students(Person):
    def __init__(self,name,age,sex,xueli):
        self.xueli = xueli
        super().__init__(name,age,sex)
    def xuesheng(self):
        print("我叫%s,我今年%d 性别%s  我是一名%s学生" % (self.name,self.age,self.sex,self.xueli))

    def communication(self,programmer):
        print('%s: python好学吗? %s:人生苦短我用python' % (self.name,programmer.thejob))
        programmer.thejob()

class programmer(Person):
    def __init__(self,name,age,sex,zhiwei):
        self.zhiwei = zhiwei
        super().__init__(name,age,sex)
    def thejob(self):
        print("我叫%s, 我今年%d  性别%s  我是一名%s程序员" % (self.name,self.age,self.sex,self.zhiwei))




xiaoming = students('小明',19,'男','大')
xiaoming.xuesheng()

daming = programmer('大明',25,'男','web开发')
daming.thejob()
xiaoming.communication(daming)
